import {defineStore} from "pinia";
export const UserInfoStore = defineStore('getUsername', {
    state:()=>({
        id:null,
        userID:null,
        username:null,
        role:null,
    }),
    actions:{
        saveName(username){
            this.username = username;
        },
        saveToken(token){
            this.token = token;
        },
        saveCsmsUser(csmsUser){
            this.id = csmsUser.id;
            this.userID = csmsUser.userID;
            this.username = csmsUser.username;
            this.role = csmsUser.role;
        }
    }
});